🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

textlint

Package Overview
Dependencies
Maintainers
2
Versions
244
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

textlint

The pluggable linting tool for text and markdown.

8.2.1
Source
npm
Version published
Maintainers
2
Created
Source

Architecture

Overview

overview

title: Architecture
CLI->Engine: file*s*
Engine->Core: file
Core->Kernel: text
Kernel->Kernel: Linting text
Kernel-->Core: Message
Core-->Engine: Results
Engine-->CLI: output
  • CLI know Engine
  • Engine know Core
  • Core know kernel

textlint apply Separation of Concern.

CLI

Concern

  • Parse command line options
  • Run Engine
  • Receive results
  • output to stdout/stderr

Engine

Process files are wanted to lint/fix and prepare configuration of rules and plugins. After all, return a array of TextLintResult or TextLintFixResult

  • engine/ directory
  • textlint-engine.js
  • rule-manager.js
  • textlint-module-resolver.js

These are shared between config and engine. Don't shared between engine and core.

Concern

  • Prepare rules from config
  • Pass rules and configs to Core
  • Could handle multiple files

Core

Process file/text wanted to lint/fix. After all, return a TextLintResult or TextLintFixResult

  • core/ directory
  • textlint-core.js
  • source-code.js
  • rule-creator-set.js
  • task/
  • linter/
  • fixer/

To be clear about difference of linter and fixer.

  • Linter process in parallel.
  • Fixer process in series.

Concern

  • Handle AST of the text
  • Do linting to the AST
  • Create fixable messages from the result
  • Could handle a single files

Terms

  • Ignore: a rule request to ignore range
  • Filter: textlint filter requested range that is reported by rule
    • a rule can't filter.

Keywords

plugable

FAQs

Package last updated on 21 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts